<template>
  <div class="contents">
    <el-tabs v-model="activeName">
      <el-tab-pane label="出入库汇总" name="first">
        <el-row :gutter="10">
          <el-col :span="4">
            <el-select placeholder="全部仓库">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-col>
          <el-col :span="4">
            <el-select placeholder="全部分类">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-col>
          <el-col :span="5">
            <el-date-picker
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 200px;"
            ></el-date-picker>
          </el-col>
          <el-col :span="5">
            <el-input placeholder="输入单号/制单人">
              <el-button slot="append" icon="el-icon-search"></el-button>
            </el-input>
          </el-col>
        </el-row>
        <div class="btn-fixed">
          <el-button>导出</el-button>
          <el-button>表头设置</el-button>
        </div>
        <el-table :data="table1" style="width: 100%; margin-top: 10px;">
          <el-table-column prop="address" label="商品名称"></el-table-column>
          <el-table-column prop="address" label="描述"></el-table-column>
          <el-table-column prop="address" label="单位"></el-table-column>
          <el-table-column prop="address" label="仓库"></el-table-column>
          <el-table-column prop="address" label="入库数量"></el-table-column>
          <el-table-column prop="address" label="出库数量"></el-table-column>
          <el-table-column prop="address" label="现有库存"></el-table-column>
          <el-table-column prop="address" label="入库金额"></el-table-column>
          <el-table-column prop="address" label="出库金额"></el-table-column>
          <el-table-column prop="address" label="操作"></el-table-column>
        </el-table>
        <div class="totalMount">
          <span>入库金额合计:</span>
          <span style="padding-left: 20px;">出库金额合计:</span>
        </div>
        <el-pagination
          background
          layout="total, prev, pager, next,sizes, jumper"
          :page-size="10"
          :page-sizes="[10, 20, 30, 40]"
          style="text-align: left;"
          :total="0"
        />
      </el-tab-pane>
      <el-tab-pane label="出入库流水" name="second">
        <el-form
          class="demo-form-inline"
          :inline="true"
          label-position="right"
          label-width="80px"
          :model="formInline"
        >
          <el-form-item label="仓库:">
            <el-select placeholder="全部仓库">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="日期:">
            <el-date-picker
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 215px;"
            ></el-date-picker>
          </el-form-item>
          <el-form-item
            :style="{ visibility: !openCol ? 'hidden' : 'visible' }"
          >
            <el-button type="primary">查询</el-button>
            <el-button>导出</el-button>
          </el-form-item>
          <el-form-item>
            <el-button
              style="margin-left: 85px;"
              type="text"
              @click="clickOpen"
            >
              <span :style="{ visibility: openCol ? 'hidden' : 'visible' }">
                收起
              </span>
              高级筛选
              <vab-icon
                :icon="openCol ? 'arrow-down-s-line' : 'arrow-up-s-line'"
              />
            </el-button>
          </el-form-item>
          <br />
          <div v-show="!openCol">
            <el-form-item label="分类:">
              <el-select placeholder="全部分类">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="搜索:">
              <el-input
                v-model="formInline.user"
                placeholder="请输入商品编码/名称/别名"
                style="width: 215px;"
              />
            </el-form-item>
            <br />
            <el-form-item style="margin-left: 80px;">
              <el-button type="primary">查询</el-button>
              <el-button>重置</el-button>
              <el-button>导出</el-button>
            </el-form-item>
          </div>
        </el-form>
        <el-table :data="table1" style="width: 100%;">
          <el-table-column width="50px">
            <template slot="header" slot-scope>
              <i class="el-icon-s-operation"></i>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="商品名称"></el-table-column>
          <el-table-column prop="address" label="单位"></el-table-column>
          <el-table-column prop="address" label="类型"></el-table-column>
          <el-table-column prop="address" label="来源"></el-table-column>
          <el-table-column prop="address" label="关联单号"></el-table-column>
          <el-table-column prop="address" label="出库时间"></el-table-column>
          <el-table-column prop="address" label="入库时间"></el-table-column>
          <el-table-column
            prop="address"
            label="出入库数量"
            width="120px"
          ></el-table-column>
          <el-table-column prop="address" label="结余库存"></el-table-column>
          <el-table-column prop="address" label="进货价"></el-table-column>
          <el-table-column prop="address" label="出货价"></el-table-column>
          <el-table-column prop="address" label="成本价"></el-table-column>
          <el-table-column
            prop="address"
            label="出入库金额"
            width="120px"
          ></el-table-column>
        </el-table>
        <el-pagination
          background
          layout="total, prev, pager, next,sizes"
          :page-size="10"
          :page-sizes="[20, 30, 40, 50]"
          style="text-align: right;"
          :total="0"
        />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        activeName: 'first',
        options: [],
        formInline: {},
        openCol: true,
      }
    },
    methods: {
      clickOpen() {
        this.openCol = !this.openCol
      },
    },
  }
</script>

<style lang="scss" scoped>
  .contents {
    padding: 0 20px 10px;

    .totalMount {
      height: 49px;
      background: #f5f7fa;
      text-align: right;
      font-size: 13px;
      padding: 15px;
    }

    .btn-fixed {
      position: fixed;
      top: 133px;
      right: 50px;
      z-index: 12;
    }
  }
</style>
